'\" t
.\"     Title: IPSEC_SHOWPOLICY
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 10/06/2010
.\"    Manual: [FIXME: manual]
.\"    Source: [FIXME: source]
.\"  Language: English
.\"
.TH "IPSEC_SHOWPOLICY" "8" "10/06/2010" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ipsec_showpolicy \- dump policy of socket found as stdin
.SH "SYNOPSIS"
.HP \w'\fBipsec\fR\ 'u
\fBipsec\fR \fIshowpolicy\fR
.br

.HP \w'\fBipsec\ showpolicy\fR\ 'u
\fBipsec showpolicy\fR \-\-udp\fIport\fR\ \-\-sockpolicy \-\-packetcount\fInum\fR
.br

.SH "DESCRIPTION"
.PP
\fIshowpolicy\fR
calls the
\fBipsec_policy_lookup\fR(3)
function on the file description which is its stdin\&.
.PP
It then dumps the resulting query in a human readable form\&.
.PP
With the \-\-udp option, it opens a UDP port, and dumps policy on each packet received on that port using the IP_IPSEC_RECVREF socket option\&.
.PP
The \-\-maxpacket option causes the program to exit after processing that many packets\&. This can be used in test cases\&.
.PP
This is a test program\&. One might run it from inetd, via:
.PP
discard stream tcp nowait nobody /usr/local/libexec/ipsec/showpolicy showpolicy
.PP
One could also run it from the command line via:
.PP
ipsec showpolicy \-\-udp 9 \-\-sockpolicy \-\-maxpacket 2
.SH "FILES"
.PP
/var/run/pluto/ipsecpolicy\&.ctl
.SH "SEE ALSO"
.PP
\fBipsec\fR(8),
\fBipsec_policy_query\fR(3),
\fBipsec_pluto\fR(8)
.SH "HISTORY"
.PP
Written for the Linux FreeS/WAN project <\m[blue]\fBhttp://www\&.freeswan\&.org/\fR\m[]> by Michael Richardson
